{% extends "JobHubBundle::layout.html.twig" %}

{% block title %}{{ parent() }} - Candidat{% endblock %}

{% block navbar %}
{{ parent() }}
{% endblock %}

{% block contenu %}

{% if edit_form %}
<div class="clearfix bloc_bulbe">
<img class="pull-left" src="{{ asset('bundles/jobhub/images/icons/utils/glyphicons_064_lightbulb.png') }}"/>
<p>Votre profil n'est pas complet. Veuillez remplir ce formulaire</p>
</div>
<div class="clearfix contenu_header">
	<h2 class="pull-left bloc_info_titre">Votre Profil Candidat</h2>
</div>
<div class="bloc_info">
<form class="candidat_profil_form" action="{{ path('job_hub_candidat_update') }}" method="POST" {{ form_enctype(edit_form) }}>
	<h4>Information Générales</h4>
	<table class="record_properties">
		<tbody>
			<tr>
                <th>Votre nom</th>
                <td>{{ form_widget(edit_form.nom) }}</td>
            </tr>
            <tr>
                <th>Votre prénom</th>
                <td>{{ form_widget(edit_form.prenom) }}</td>
            </tr>
            <tr>
                <th>Votre date de naissance</th>
                <td>{{ form_widget(edit_form.birthday)}}</td>
            </tr> 
            <tr>
                <th>Votre sexe</th>
                <td>{{ form_widget(edit_form.sex) }}</td>
            </tr> 
            <tr>
                <th>Site personnel</th>
                <td>{{ form_widget(edit_form.sitePerso) }}</td>
            </tr>
        </tbody>
	</table>
	<h4>Vos coordonnées</h4>
	<table class="record_properties">
		<tbody>
            <tr>
                <th>Numéro de téléphone</th>
                <td>{{ form_widget(edit_form.telephone) }}</td>
            </tr>
            <tr>
                <th>Adresse</th>
                <td>{{ form_widget(edit_form.adresse) }}</td>
            </tr>
            <tr>
                <th>Code Postal</th>
                <td>{{ form_widget(edit_form.codePostal)}}</td>
            </tr> 
            <tr>
                <th>Ville</th>
                <td>{{ form_widget(edit_form.ville)}}</td>
            </tr>
            <tr>
                <th>Photot de votre profil</th>
                <td>{{ form_widget(edit_form.photoProfil)}}</td>
            </tr>
        </tbody>
	</table>
    {{ form_rest(edit_form) }}
</form>
</div>

{% else %}
<div class="clearfix contenu_header">
	<div class="pull-left">
		<div class="clearfix">
			<img class="img_profil thumbnail  pull-left" src="{{asset(entity.pathPhotoProfil)}}"/>	
			<h2 class="pull-right"> <b>Votre Profil Candidat</b> </h2>
		</div>
	</div>
	<a class="pull-right bloc_info_right_link" href="{{ path('job_hub_candidat_edit') }}">Modifier</a>
</div>

<div class="clearfix bloc_info">
<div class="pull-left candidat_profil_info_base">
	<h3 class="bloc_info_titre">Information Générales</h3>
	<div class="bloc_info_contenu">
	    <table class="record_properties">
        <tbody>
            <tr>
                <td>{{ entity.nom }} {{ entity.prenom }}</td>
            </tr>
            <tr>
                <th>Username</th>
                <td>{{ entity.compteUser.username }}</td>
            </tr>
            <tr>
                <th>Date de Naissance</th>
                {% if entity.birthday %}
                <td>{{ entity.birthday|date('Y-m-d') }}</td>
                {% endif %}
            </tr>
            <tr>
                <th>Sexe</th>
                {% if entity.sex == 'F' %}
                <td>Femme</td>
                {% elseif entity.sex == 'M' %}
                <td>Homme</td>
                {% endif %}
            </tr>
            <tr>
                <th>Lastlogin</th>
                <td>{{ entity.compteUser.lastLogin|date('Y-m-d') }}</td>
            </tr>
            <tr>
                <th>Siteperso</th>
                <td>{{ entity.sitePerso }}</td>
            </tr>
        </tbody>
    </table>
	</div>
</div>

<div class="candidat_profil_info_base pull-right">
	<h3 class="bloc_info_titre">Vos coordonnées</h3>
	<div class="bloc_info_contenu">
		<table class="record_properties">
		    <tbody>
		        <tr>
		            <th>Email</th>
		            <td>{{ entity.compteUser.email }}</td>
		        </tr>
		        <tr>
		            <th>Telephone</th>
		            <td>{{ entity.telephone }}</td>
		        </tr>
		        <tr>
		            <th>Adresse</th>
		            {% if entity.adresse %}
		            <td>{{ entity.adresse }}</br>
		            {{ entity.ville.codePostal }}, {{ entity.ville.nom }}</br>
		            {{ entity.ville.region.nom }}, {{ entity.ville.region.pays.nomFr }}</td>
		            {% endif %}
		        </tr>
		    </tbody>
		</table>
	</div>
</div>
</div>
<div class="bloc_info" id="candidat_profile_formation">
	<div class="clearfix">
		<h3 class="pull-left bloc_info_titre">Formation & Scolarité</h3>
		<a class="bloc_info_right_link pull-right" data-toggle="collapse" data-parent="#candidat_profile_formation" href="#candidat_profile_new_formation_form">Ajouter</a>
	</div>
	{% if entity.formations|length > 0 %}
	<table class="table records_list">
	    <thead>
	        <tr>
	            <th>Annee</th>
	            <th>Libellediplome</th>
	            <th>Etablissement</th>
	            <th>Actions</th>
	        </tr>
	    </thead>
	    <tbody>
	    {% for formation in entity.formations %}
	        <tr>
	            <td>{{ formation.anneeDebut|date('Y') }} - {{ formation.anneeFin|date('Y') }}</td>
	            <td><a href="{{ path('candidat_profile_formation_show', { 'id': formation.id }) }}">{{ formation.libelleDiplome }}</a></td>
	            <td>{{ formation.etablissement }}</td>
	            <td>
	                <a href="{{ path('candidat_profile_formation_show', { 'id': formation.id }) }}">Détails</a> |
	                <a href="{{ path('candidat_profile_formation_edit', { 'id': formation.id }) }}">Modifier</a>|
                    <a href="{{ path('candidat_profile_formation_delete', { 'id': formation.id }) }}">Supprimer</a>
	            </td>
	        </tr>
	    {% endfor %}
	    </tbody>
	</table>
	{% else %}
	<p>Vous n'avez pas encore communiqué votre parcours scolaire</p>
	{% endif %}
	<div id="candidat_profile_new_formation_form" class="collapse">
	{{ render(controller( 'JobHubBundle:Formation:new' )) }}
	</div>
</div>

<div class="bloc_info" id="candidat_profile_experience" >
	<div class="clearfix">
		<h3 class="pull-left bloc_info_titre">Emplois & Experience</h3>
		<a class="bloc_info_right_link pull-right" data-toggle="collapse" data-parent="#candidat_profile_experience" href="#candidat_profile_new_experience_form">Ajouter</a>
	</div>	
	{% if entity.experiences|length > 0 %}
    <table class="table records_list">
        <thead>
            <tr>
                <th>Années</th>
                <th>Fonction</th>
                <th>Entreprise</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for experience in entity.experiences %}
            <tr>
                <td>{{ experience.dateDebut|date('Y-m') }} - {{ experience.dateFin|date('Y-m') }}</td>
                <td>
                <a href="{{ path('candidat_profile_experience_show', { 'id': experience.id }) }}">
                {{ experience.fonction }}
                </a>
                </td>
                <td>{{ experience.entreprise }}</td>
                <td>
                    <a href="{{ path('candidat_profile_experience_show', { 'id': experience.id }) }}">Détails</a> |
                    <a href="{{ path('candidat_profile_experience_edit', { 'id': experience.id }) }}">Modifier</a> |
                    <a href="{{ path('candidat_profile_experience_delete', { 'id': experience.id }) }}">Supprimer</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% else %}
Vous n'avez pas encore communiqué vos expériences professionnelles
{% endif %}
	<div id="candidat_profile_new_experience_form" class="collapse">
	{{ render(controller( 'JobHubBundle:Experience:new' )) }}
	</div>
</div>
{% endif %}
{% endblock %} 

{% block sidebar %}
{{ render(controller( 'JobHubBundle:JobHub:bloc',  {'nom_rubrique': 'faq'} )) }}
{{ render(controller( 'JobHubBundle:JobHub:bloc',  {'nom_rubrique': 'conseil'} )) }}
{% endblock %} 

{% block footer %}
{{ parent() }}
{% endblock %}


